/**
 * @file RK_Info.h
 * @brief The class to store coefficients of Runge-Kutta method.
 * @author XDDDD
 * @version 
 * @date 2021-04-28
 */

#ifndef __PAISLEYPARK__RK_INFO_H__
#define __PAISLEYPARK__RK_INFO_H__

#include <iostream>

class RK_Info {
private:
	double* __A;
	double* __B;
	double* __C;
	std::size_t __S;
public:
	/**
	 * @brief Constructor.
	 */
	RK_Info();
	/**
	 * @brief Constructor.
	 *
	 * @param _s The given number of steps.
	 */
	RK_Info(const std::size_t _s);
	/**
	 * @brief Constructor.
	 *
	 * @param _a The given array of a.
	 * @param _b The given array of b.
	 * @param _c The given array of c.
	 * @param _s The given number of steps.
	 */
	RK_Info(const double* _a, const double *_b, const double* _c, const std::size_t _s);
	/**
	 * @brief Destructor.
	 */
	~RK_Info();
	/**
	 * @brief Get a[i].
	 *
	 * @param _i The index.
	 *
	 * @return __a[i].
	 */
	const double get_a_i(const std::size_t _i) const;
	/**
	 * @brief Get b[i].
	 *
	 * @param _i The index.
	 *
	 * @return __b[i].
	 */
	const double get_b_i(const std::size_t _i) const;
	/**
	 * @brief Get c[i].
	 *
	 * @param _i The index.
	 *
	 * @return __c[i].
	 */
	const double get_c_i(const std::size_t _i) const;
	/**
	 * @brief Set the information.
	 *
	 * @param _a The given array of a.
	 * @param _b The given array of b.
	 * @param _c The given array of c.
	 * @param _s The number of steps.
	 */
	void set_info(const double *_a, const double *_b, const double *_c, const std::size_t _s);
	/**
	 * @brief Get the number of steps.
	 *
	 * @return __S.
	 */
	const std::size_t get_s() const;
	/**
	 * @brief Reload the operator =.
	 *
	 * @param _rk_info The given rk information.
	 *
	 * @return This.
	 */
	const RK_Info& operator=(const RK_Info &_rk_info);
	/**
	 * @brief Show the information.
	 */
	void show() {
		std::cout << "Show RK_Info" << std::endl; 
		for(int i = 0; i != __S; i++) {
			std::cout << __C[i] << '\t' << __B[i] << std::endl;
		}
		for(int i = 0; i != __S*(__S - 1)/2; i++) {
			std::cout << __A[i] << std::endl;
		}
	}
};

#else
//Do nothing.
#endif
